/*
 *  Copyright (C) 2010 Matthias Buch-Kromann <mbk.isv@cbs.dk>
 * 
 *  This file is part of the MatrixParser package.
 *  
 *  The MatrixParser program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 * 
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 * 
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package org.osdtsystem.matrixparser.parsers;

import java.io.Writer;
import org.osdtsystem.matrixparser.features.TwoWayFeatureHandler;
import org.osdtsystem.matrixparser.parsers.output.DependencyTree;

/**
 *
 * @author Matthias Buch-Kromann <mbk.isv@cbs.dk>
 */
public class Action {
    double score;
    int[] action;

    Action(double score, int... actions) {
        this.score = score;
        this.action = actions;
    }

    // Score
    final double score() { return score; }
    final int[] action() { return action; }
    final int get(int i) { return action[i]; }

    static Action make(double score, int... actions) {
        return new Action(score, actions);
    }

    void writeAsDTAG(Writer writer, TwoWayFeatureHandler labels) throws java.io.IOException {
        writer.append("# [action]: ").append(action.toString()).append(" score=" + score + "\n");
    }
}
